package com.ysm.smfu.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/**
 * Created by Administrator on 2016/9/30.
 */
public abstract class TypeAdapter extends BaseAdapter {

    public String[] strings;

    public TypeAdapter(String[] strings) {
        this.strings = strings;
    }

    public void setDatas(String[] strings) {
        this.strings = strings;
        notifyDataSetChanged();
    }

    @Override
    public int getCount() {
        if (strings == null) {
            return 0;
        }
        return strings.length;
    }

    @Override
    public Object getItem(int position) {
        return strings[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public abstract View getView(int position, View convertView, ViewGroup parent);
}
